import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import UserLoginView from '@/views/user/UserLoginView.vue'
import UserMagageView from '@/views/user/UserMagageView.vue'
import PictureAddView from '@/views/picture/PictureAddView.vue'
import PictureMagageView from '@/views/picture/PictureMagageView.vue'
import PictureDetails from '@/views/picture/PictureDetails.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/user/login',
      name: 'login',
      component: UserLoginView,
    },
    {
      path: '/user/manage',
      name: 'userManage',
      component: UserMagageView,
    },
    {
      path: '/picture/add',
      name: 'pictureAdd',
      component: PictureAddView,
    },
    {
      path: '/picture/manage',
      name: 'pictureManage',
      component: PictureMagageView,
    },
    {
      path: '/picture/details/:id',
      name: 'details',
      component: PictureDetails,
      props: true,
    },
  ],
})

export default router
